package com.semidata.trp.algorithm.request;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

import com.semidata.rtd.core.json.JsonObject;
public class StrategyContext {
	private Timestamp timestamp;
	private JsonObject params;
	private Integer positionId;
	private Integer positionColumns;
	private Integer hour;
	private String areaCode;
	private String requestKeyWord1;
	private String requestKeyWord2;
	private String requestKeyWord3;
	private Map<String,Integer> materialFrequency;
	private Integer mediaType;
	private Double orgTodayInternalCost;
	private Double orgTotalInternalCost;
	private Double orgTodayExternalCost;
	private Double orgTotalExternalCost;
	private Double orgTodayAllyCost;
	private Double orgTotalAllyCost;
	private Long resourceTodayClick;
	private Long resourceTotalClick;
	private Long resourceTodayImpression;
	private Long resourceTotalImpression;
	private Double strategyTodayInternalCost;
	private Double strategyTotalInternalCost;
	private Double strategyTodayExternalCost;
	private Double strategyTotalExternalCost;
	private Double strategyTodayAllyCost;
	private Double strategyTotalAllyCost;
	private Long strategyTodayClick;
	private Long strategyTotalClick;
	private Long strategyTodayInternalImpression;
	private Long strategyTotalInternalImpression;
	private Long strategyTodayExternalImpression;
	private Long strategyTotalExternalImpression;
	private Long strategyTodayAllyImpression;
	private Long strategyTotalAllyImpression;
	private double strategyTotalInternalBudget;
	private double strategyDailyInternalBudget;
	private double strategyTotalExternalBudget;
	private double strategyDailyExternalBudget;
	private double strategyTotalAllyBudget;
	private double strategyDailyAllyBudget;
	private double resourceFloor;
	private List<String> materialsId;
	private StringBuffer logStr;
	public StrategyContext() {
		this.timestamp = new Timestamp(System.currentTimeMillis());
		this.resourceFloor = 0.0;
		this.logStr = new StringBuffer();
	}
	
	public void log(String log) {
		this.logStr.append(log);
		this.logStr.append("\n");
	}
	
	public String getLog() {
		if (this.logStr.length() == 0)
			return "no log";
		else
			return this.logStr.toString();
	}
	
	public void setParams(JsonObject params) {
		this.params = params;
	}
	
	public void setMediaType(Integer mediaType) {
		this.mediaType = mediaType;
	}
	public void setPositionId(Integer id) {
		this.positionId = id;
	}
	public void setPositionColumns(Integer positionColumns) {
		this.positionColumns = positionColumns;
	}

	public void setHour(Integer hour) {
		this.hour = hour;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	public void setRequestKeyWord1(String requestKeyWord1) {
		this.requestKeyWord1 = requestKeyWord1;
	}

	public void setRequestKeyWord2(String requestKeyWord2) {
		this.requestKeyWord2 = requestKeyWord2;
	}

	public void setRequestKeyWord3(String requestKeyWord3) {
		this.requestKeyWord3 = requestKeyWord3;
	}

	public void setMaterialFrequency(Map<String, Integer> materialFrequency) {
		this.materialFrequency = materialFrequency;
	}

	public void setOrgTodayInternalCost(Double orgTodayInternalCost) {
		this.orgTodayInternalCost = orgTodayInternalCost;
	}

	public void setOrgTotalInternalCost(Double orgTotalInternalCost) {
		this.orgTotalInternalCost = orgTotalInternalCost;
	}

	public void setOrgTodayExternalCost(Double orgTodayExternalCost) {
		this.orgTodayExternalCost = orgTodayExternalCost;
	}

	public void setOrgTotalExternalCost(Double orgTotalExternalCost) {
		this.orgTotalExternalCost = orgTotalExternalCost;
	}

	public void setOrgTodayAllyCost(Double orgTodayAllyCost) {
		this.orgTodayAllyCost = orgTodayAllyCost;
	}

	public void setOrgTotalAllyCost(Double orgTotalAllyCost) {
		this.orgTotalAllyCost = orgTotalAllyCost;
	}

	public void setResourceTodayClick(Long resourceTodayClick) {
		this.resourceTodayClick = resourceTodayClick;
	}

	public void setResourceTotalClick(Long resourceTotalClick) {
		this.resourceTotalClick = resourceTotalClick;
	}

	public void setResourceTodayImpression(Long resourceTodayImpression) {
		this.resourceTodayImpression = resourceTodayImpression;
	}

	public void setResourceTotalImpression(Long resourceTotalImpression) {
		this.resourceTotalImpression = resourceTotalImpression;
	}

	public void setStrategyTodayInternalCost(Double strategyTodayInternalCost) {
		this.strategyTodayInternalCost = strategyTodayInternalCost;
	}

	public void setStrategyTotalInternalCost(Double strategyTotalInternalCost) {
		this.strategyTotalInternalCost = strategyTotalInternalCost;
	}

	public void setStrategyTodayExternalCost(Double strategyTodayExternalCost) {
		this.strategyTodayExternalCost = strategyTodayExternalCost;
	}

	public void setStrategyTotalExternalCost(Double strategyTotalExternalCost) {
		this.strategyTotalExternalCost = strategyTotalExternalCost;
	}

	public void setStrategyTodayAllyCost(Double strategyTodayAllyCost) {
		this.strategyTodayAllyCost = strategyTodayAllyCost;
	}

	public void setStrategyTotalAllyCost(Double strategyTotalAllyCost) {
		this.strategyTotalAllyCost = strategyTotalAllyCost;
	}

	public void setStrategyTodayClick(Long strategyTodayClick) {
		this.strategyTodayClick = strategyTodayClick;
	}

	public void setStrategyTotalClick(Long strategyTotalClick) {
		this.strategyTotalClick = strategyTotalClick;
	}

	public void setStrategyTodayInternalImpression(
			Long strategyTodayInternalImpression) {
		this.strategyTodayInternalImpression = strategyTodayInternalImpression;
	}

	public void setStrategyTotalInternalImpression(
			Long strategyTotalInternalImpression) {
		this.strategyTotalInternalImpression = strategyTotalInternalImpression;
	}

	public void setStrategyTodayExternalImpression(
			Long strategyTodayExternalImpression) {
		this.strategyTodayExternalImpression = strategyTodayExternalImpression;
	}

	public void setStrategyTotalExternalImpression(
			Long strategyTotalExternalImpression) {
		this.strategyTotalExternalImpression = strategyTotalExternalImpression;
	}

	public void setStrategyTodayAllyImpression(Long strategyTodayAllyImpression) {
		this.strategyTodayAllyImpression = strategyTodayAllyImpression;
	}

	public void setStrategyTotalAllyImpression(Long strategyTotalAllyImpression) {
		this.strategyTotalAllyImpression = strategyTotalAllyImpression;
	}

	public Integer getPositionId() {
		return this.positionId;
	}
	public Integer getPositionColumns() {
		return this.positionColumns;
	}
	
	public Integer getHour() {
		return this.timestamp.getHours();
	}
	
	public String getAreaCode() {
		return this.areaCode;
	}
	public JsonObject getParams() {
		return this.params;
	}
	public String getRequestKeyWord1() {
		return this.requestKeyWord1;
	}
	
	public String getRequestKeyWord2() {
		return this.requestKeyWord2;
	}
	
	public String getRequestKeyWord3() {
		return this.requestKeyWord3;
	}
	
	public Map<String, Integer> getMaterialFrequency() {
		return this.materialFrequency;
	}
	
	
	public Double getOrgTodayInternalCost() {
				
		return this.orgTodayInternalCost == null ? 0.0 : this.orgTodayInternalCost; 
	}
	
	public Double getOrgTodayExternalCost() {
				
		return this.orgTodayExternalCost == null ? 0.0 : this.orgTodayExternalCost;
	}
	
	public Double getOrgTodayAllyCost() {
		return this.orgTodayAllyCost == null ? 0.0 : this.orgTodayAllyCost;
	
	}
	
	public Double getOrgTotalInternalCost() {
		
		return this.orgTotalInternalCost == null ? 0.0 : this.orgTotalInternalCost;
	}
	
	public Double getOrgTotalExternalCost() {
		
		return this.orgTotalExternalCost == null ? 0.0 : this.orgTotalExternalCost;
	}
	
	public Double getOrgTotalAllyCost() {
		
		return this.orgTotalAllyCost == null ? 0.0 : this.orgTotalAllyCost;
	}
	
	public Long getResourceTodayClick() {
		return this.resourceTodayClick == null ? 0l : this.resourceTodayClick;
	}
	
	public Long getResourceTotalClick() {
		return this.resourceTotalClick == null ? 0l : this.resourceTotalClick;
	}
	
	public Long getResourceTodayImpression() {
		return this.resourceTodayImpression == null ? 0l : this.resourceTodayImpression;
	}
	
	public Long getResourceTotalImpression() {
		return this.resourceTotalImpression == null ? 0l : this.resourceTotalImpression;
	}
	
	public Long getStrategyTodayClick() {
		return this.strategyTodayClick == null ? 0l : this.strategyTodayClick;
	}
	
	public Long getStrategyTotalClick() {
		return this.strategyTotalClick == null ? 0l : this.strategyTotalClick;
	}
	
	public Long getStrategyTodayInternalImpression() {
		return this.strategyTodayInternalImpression == null ? 0l : this.strategyTodayInternalImpression;
	}
	
	public Long getStrategyTodayExternalImpression() {
		return this.strategyTodayExternalImpression == null ? 0l : this.strategyTodayExternalImpression;
	}
	
	public Long getStrategyTodayAllyImpression() {
		return this.strategyTodayAllyImpression == null ? 0l : this.strategyTodayAllyImpression;
	}
	
	public Long getStrategyTotalInternalImpression() {
		return this.strategyTotalInternalImpression == null ? 0l : this.strategyTotalInternalImpression;
	}
	
	public Long getStrategyTotalExternalImpression() {
		return this.strategyTotalExternalImpression == null ? 0l : this.strategyTotalExternalImpression;
	}
	
	public Long getStrategyTotalAllyImpression() {
		return this.strategyTotalAllyImpression == null ? 0l : this.strategyTotalAllyImpression;
	}
	
	public Double getStrategyTodayInternalCost() {
		
		return this.strategyTodayInternalCost == null ? 0.0 : this.strategyTodayInternalCost;
	}
	
	public Double getStrategyTodayExternalCost() {
				
		return this.strategyTodayExternalCost == null ? 0.0 : this.strategyTodayExternalCost;
	}
	
	public Double getStrategyTodayAllyCost() {
		return this.strategyTodayAllyCost == null ? 0.0 : this.strategyTodayAllyCost;
	
	}
	
	public Double getStrategyTotalInternalCost() {
		
		return this.strategyTotalInternalCost == null ? 0.0 : this.strategyTotalInternalCost;
	}
	
	public Double getStrategyTotalExternalCost() {
		
		return this.strategyTotalExternalCost == null ? 0.0 : this.strategyTotalExternalCost;
	}
	
	public Double getStrategyTotalAllyCost() {
		
		return this.strategyTotalAllyCost == null ? 0.0 : this.strategyTotalAllyCost;
	}
	
	public int getMediaType() {
		return this.mediaType;
	}
	
	public void setTotalBudgetIn(double totalBudgetIn) {
		this.strategyTotalInternalBudget= totalBudgetIn;
	}

	public void setDailyBudgetIn(double dailyBudgetIn) {
		this.strategyDailyInternalBudget = dailyBudgetIn;
	}

	public void setTotalBudgetOut(double totalBudgetOut) {
		this.strategyTotalExternalBudget = totalBudgetOut;
	}

	public void setDailyBudgetOut(double dailyBudgetOut) {
		this.strategyDailyExternalBudget= dailyBudgetOut;
	}

	public void setTotalBudgetAlly(double totalBudgetAlly) {
		this.strategyTotalAllyBudget = totalBudgetAlly;
	}

	public void setDailyBudgetAlly(double dailyBudgetAlly) {
		this.strategyDailyAllyBudget= dailyBudgetAlly;
	}
	
	public double getStrategyTotalInternalBudget() {
		return this.strategyTotalInternalBudget;
	}

	public double getStrategyDailyInternalBudget() {
		return this.strategyDailyInternalBudget;
	}

	public double getStrategyTotalExternalBudget() {
		return this.strategyTotalExternalBudget;
	}

	public double getStrategyDailyExternalBudget() {
		return this.strategyDailyExternalBudget;
	}

	public double getStrategyTotalAllyBudget() {
		return this.strategyTotalAllyBudget;
	}

	public double getStrategyDailyAllyBudget() {
		return this.strategyDailyAllyBudget;
	}

	public void setMaterialsId(List<String> ids) {
		this.materialsId = ids;
	}
	
	public List<String> getMaterialsId() {
		
		return this.materialsId;
	}
	
	public void setResourceFloor(double resourceFloor) {
		this.resourceFloor = resourceFloor;
	}
	
	public double getResourceFloor() {
		return this.resourceFloor;
	}
	
}
